Namespaces

Types in MathNet.Numerics.Statistics.Mcmc

Type MetropolisSampler<T>

Namespace MathNet.Numerics.Statistics.Mcmc

Parent McmcSampler<T>

Metropolis sampling produces samples from distribution P by sampling from a proposal distribution Q and accepting/rejecting based on the density of P. Metropolis sampling requires that the proposal distribution Q is symmetric. All densities are required to be in log space. The Metropolis sampler is a stateful sampler. It keeps track of where it currently is in the domain of the distribution P.

Constructors

Methods

Properties

Public Constructors

MetropolisSampler<T>(T x0, DensityLn<T> pdfLnP, LocalProposalSampler<T> proposal, int burnInterval)

Constructs a new Metropolis sampler using the default Random random number generator.
Parameters
T x0

The initial sample.

DensityLn<T> pdfLnP

The log density of the distribution we want to sample from.

LocalProposalSampler<T> proposal

A method that samples from the symmetric proposal distribution.

int burnInterval

The number of iterations in between returning samples.

Public Methods

bool Equals(object obj)

int GetHashCode()

Type GetType()

T Sample()

Returns a sample from the distribution P.

T[] Sample(int n)

Returns a number of samples.
Parameters
int n

The number of samples we want.

Return
T[]

An array of samples.

string ToString()

Public Properties

double AcceptanceRate get;

int BurnInterval get; set;

Gets or sets the number of iterations in between returning samples.

Random RandomSource get; set;